<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>{{info}}</h1>
    <input type="button" value="测试get" @click="f1()">
    <input type="button" value="测试post" @click="f2()">
</div>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
    let v=new Vue({
        el:"div",
        data:{
            info:"测试vue"
        },
        methods:{
            f1(){
         //       alert("xxxx");
                axios.get("/helloAxios?info=tom").then(function (response){
                    //response.data代表服务器响应的数据
                    alert(response.data);
                })
            },
            f2(){
                axios.post("/helloAxios",{info:"p1"}).then(function (response){
                    alert(response.data);
                })
            }

        }
    })
</script>
</body>
</html>